Fix provider detection and saving