# Exit from tag value change script

**URL:** <https://forum.inductiveautomation.com/t/exit-from-tag-value-change-script/38402>\
**Category:** Ignition\
**Created:** [September 4, 2020, 2:16pm UTC](https://forum.inductiveautomation.com/t/exit-from-tag-value-change-script/38402 "2020-09-04T14:16:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [September 4, 2020, 2:16pm UTC](https://forum.inductiveautomation.com/t/exit-from-tag-value-change-script/38402/1 "2020-09-04T14:16:15Z")

</div>

With Ignition 8.0.12

In a tag value change script:  
import sys

```
if initialChange == 1:
	sys.exit()
if currentValue.value == 0:
	sys.exit()

```

Produce that error in the logger:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a8e7b344f81e8d7c93661c09740830ebd9250404.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 4, 2020, 2:54pm UTC](https://forum.inductiveautomation.com/t/exit-from-tag-value-change-script/38402/2 "2020-09-04T14:54:34Z")

</div>

sys.exit() is documented to kill the entire application. Obviously, Ignition doesn’t allow that. That it worked to exit certain kinds of event scripts was always a fluke. Don’t use it. Use `return`. If you aren’t in function context, delegate to a script module function where `return` will work.
