add connecting function