added rewriter call in the beginning