logic for network status change