modifications to work with esb endpoint too.