changed a addProvider() algorithm slightly