correction length_line_from_idx