added option to rebuild index