fixed bug with localStorage