change the code of match functino