added sync write & read prefs