almost complete solution for the provider error problem