fix connect bug