fix for duplicate messages on reconnect