fixed return code check for timeout