added check for peerDiscovery