finish reference matching