bug fix in match.js