fix "array subscript is above array bounds"