Fixed bug with duplication of messages