fixed logic of offline / online status for department