fix right max_length