removed unnecessary code in SendAndReceivePackets