Fix error with localStorage