implemented caching of data in LocalStorage