fix a bug with localStorage