Don't reference $prefs global directly.