changed rewrite