recognises when match is found