#29 change in the method of closing the window.