Fix bug with localStorage