Fixing reindex, placing it before db is checked