Handle master online/offline better