added a sleep when waiting for next update