Mouseup was turning into a click on whatever was the last thing clicked. In this walkthrough, this would sometimes be the "Add Area" mode button, which would re-enter the add area mode and throw away the user's drawing. (I have no idea why.)