Adding WhenAncestor extension