wait for widget exit not while true