store and restore preferences

store if setting prefences
and
restore preferences on init