fix npe if parentRef is null