error handling for cases where local storage is unavailable or not present