Adding timeout control to script