fix connection/reconnection