to keep compatibility
Fix try instantiate again provider in toProviderInstance method.