ugly hack to get constrained matching working