Fix issue where certain providers do not return the 'provider' field in the profile by using the query provider as a backup source.
Removed unused 'config' var.