fix and rebuild index