Fix bug where adding a duplicate scoped message resets the scope prematurely