Fix error when you manually set the index