fix connection logic