autoclose window after work is done or die on timeout