release the window when closed