adding length field