fixed a bug which called updateIndexes when there was no need to