Fix switchPreference