fix rewrite  caused an error