lowest common ancestor with check for nodes not even exists