1.change the logic to tell whether a node is a root node 2.deal with boolgate in getQAStats close #27