fix ipad vs localStorage issue