server: fix bug in rule matching