fixed pref loading bug