add a new method sleep_until_closed
more explicit
hopefully ok