finish createPacket method