Update index correctly