updated rebuild index script