fix connection encoding