Added a short sleep to the main loop.