I wonder if this line should be lower, once we've determined that we're going to execute this command. Otherwise, 2 commands could be sent in, the second identified with `this.lastCmd`, and run on reconnecting instead of the command that actually triggered the disconnect (say, the first command). I think doing something like this below the `return` below would work:

```js
if (!resendLast) {
  this.lastCmd = elem;
}
```