save $provider to global var