moved the sleep statement