Fix incorrect serializing array

While serializing array index was missed