fixed the bug, match code had errors