fix bug about publishing to exchange