use localstorage to cache data