Added try catch around peerExist
Made outer do while loop for entering and exiting peers.