Fix for duplicate messages being added to DOM