added rewriting handler