corrected save as functionality