fix connect fail bugs