only read localstorage if data is available