Fix localstorage error