update the index back