TimeOut code is rewritten