Finally got around to fixing the sleep time bug