hack implementation of matched term