fixed a bug where duplicate messages were being delivered to listeners