Fix sleep function call