fixed rewriter bug where postRewrite was not caching properly