fix the sleep function to return all the object variables