Upon setting a breakpoint on this line it looks like the callback for `add` and `remove` are incorrect so the original code was probably buggy too