Fix match function

Fix match function