improved code to prevent dual declaration of exchange in outbound endpoint