fix connect method