Stop running script after a certain amount of time