udpate and clean index file