Fixing bug with timeout, forcing script to close.