Changed the timing of the timeouts for improved performance