fix definePreference