Add online/offline event detection and recovery