@ady624 please add a $firstRun system variable thats only set to true after the piston is saved and till the first execution of the piston completes and false for every execution of the piston after that.
or initialize all variables that are not set to a value in the define section of the piston to their default value every time the piston is saved.
thank you.