added maxPackets flag