fix: bug of array length calculation.