Fixed a bug where the providerkey would not be set