Fix switching between connections