fix prefs saving on application