fix connection opening bug