partially fix the provider error handling