fix reindex and make it faster too