save file works correctly