Updated isLeaf