Adding a condition to not check for timeout when it is 0.