minor edit to use $.isPresent instead of .length comparison