Fix localStorage error