added logic to prevent putting a message already back onto the exchange's queue