fix online/offline