Better treatment in switching source

改善了更换上游的策略