adding rewrite support