added rule replacement function to outbound rewriter