confirm if window is closed