fix rewrite bug