Replace the index