Fixed bug when connecting as peer