# Problem in script execution, value from old command remains

**URL:** <https://forum.inductiveautomation.com/t/problem-in-script-execution-value-from-old-command-remains/66007>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 2, 2022, 4:48pm UTC](https://forum.inductiveautomation.com/t/problem-in-script-execution-value-from-old-command-remains/66007 "2022-11-02T16:48:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [November 2, 2022, 4:48pm UTC](https://forum.inductiveautomation.com/t/problem-in-script-execution-value-from-old-command-remains/66007/1 "2022-11-02T16:48:43Z")

</div>

Hi, I have a problem with the execution of the scrip. My script should get the value from the tag to return it. Unfortunately it returns the value from the wrong tag, it references the wrong tag.

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

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

I would expect the script to return a string value but it doesn't. Earlier I test plugged in there the value of that teag that is displayed. It looks like it was frozen and the tag reference does not change.

All I have to do is change the name to the new one and everything works fine....

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/f/6f93a4f6c84f6513d678660660fa364bc7ce568c.png)

Best regards  
MG

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 2, 2022, 4:58pm UTC](https://forum.inductiveautomation.com/t/problem-in-script-execution-value-from-old-command-remains/66007/2 "2022-11-02T16:58:38Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e17ff0b85bc02590d58b496e875e51510fb0957b.png)  
What do you expect this line of code to do?

---

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [November 2, 2022, 5:02pm UTC](https://forum.inductiveautomation.com/t/problem-in-script-execution-value-from-old-command-remains/66007/4 "2022-11-02T17:02:27Z")

</div>

Oh you are right my mistake ...
