An implementation of connect.pipeline that works