auto save settings in localstorage