I think you're better off doing a `jQuery(currentNode).next().length == 0` for this check.