replaced some send/getPacket with send/getByte