fixes save/close bug