moved the sleep statements