fix rebuild_index