fixed a defect with asking to save changes when closing