Fix scope of setup_provider

Fix scope of setup_provider