use the treewalker for detecting empty groups