better handling of sleep - which can be interrupted