fix array type values being misrepresented due to incorrect index