fix counting bug in array parms