fix ask to save file on closing if modified