diff --git a/app/controllers/api/v1/migrations/external_controller.rb b/app/controllers/api/v1/migrations/external_controller.rb
index 12730a617ccdb77d42b0d2fa85f6453fe90ab862..6abf10250b19947da224703c3a9ae2c9f63a90ba 100644
--- a/app/controllers/api/v1/migrations/external_controller.rb
+++ b/app/controllers/api/v1/migrations/external_controller.rb
@@ -48,7 +48,7 @@ module Api
           role_hash = role_params.to_h
 
           # Returns an error if the provider does not exist
-          if role_hash[:provider] != 'greenlight' && Tenant.find_by(provider: role_hash[:provider]).nil?
+          unless role_hash[:provider] == 'greenlight' || Tenant.exists?(name: role_hash[:provider])
             return render_error(status: :bad_request, errors: 'Provider does not exist')
           end