Updated sleepIn function