fixing save-as behavior