fix: bug of path length calculation.