fix connect close bug