Added timeout and stdout check