updated the code for RTCPeerConnection