fix fix_rewrite