added cyclic parent checking