fixed a minor bug with connection opening