Bug fix with localStorage.