localstorage bug fix