修正match與permissions