Added the use of timeouts. The timeout interval adjusts accordingly.