add transactional for rebuilding indexes too