Fixed pref check bug