fix a bug for swich provider