Fixing error computing time to sleep