Reconnect logic that works