fixed matching bug