add function to determine the peer address