Fix switch provider when it host app removed.