Add error handling for offline usage.