fixed error saving prefs