fixed rewrite error