try/catch the localstorage setting