Shouldn't this use the jQuery `on` and `off` functions?