Added mutex to fix bug in PeerMonitor