fix bug with online/offline callback