fix connection bug