bug fix: isLeaf()