end case handling for sleep