corrected UpdateIndices