Try to make timeout check more robust