Using localstorage to save data offline.