check if child comm is ancestor of parent