Added query to rule matching.