adds with-connection macro