Change the prune_ancestor method visibility to public instead of protected