impletement preference, but not work localstorage ;(