fix rewrite ruleset