Fix if pref not defined