Did you run your script in debug mode?
start the script with the Break ON command. If you don't use Break ON the system logs off when you Break the script...
_________________________
Co