I already do a sleep 1. Do I need 2 seconds?
Did you get it to run in a terminal with the suggestions?
Try different sleep settings to see if it works. It also depends what cpu/mem you have in other words the faster your system is the longer sleep you might need.
I tried it with longer sleep (up to 10 seconds) same issue...just exits out of the script as soon as it self terminates.