fixed bug in match