If you didn't already notice, the bug was that the DOM element got deleted externally (`refresh()` I think), but the old jQuery object was still used.