udpate the index