switching to use isAncestorOf as suggested, in order to avoid the ancestor call which apparently can trigger an evaluation through python