Added sleep helper function.