some fixes in sendPacket