fixed dealing with script timeouts