fix connection factory