updating the index