not exitting when window is closed