fix reference to index