added try around prefs
added try around prefs