fix bug about publishing to exchange
Merge pull request #815 from dimagi/exchange-fixes

fix bug about publishing to exchange