Updates the index