fix to rewriter