fix a miss use of array-length