added hasChildren() method