I think it is necessary to stop the script after pressing the button. Add "halt" after the button line.
That worked! Thanks for the help.