Move the sleep into a better place