Added functionality for offline mode.