fixed some bugs in associative matching