added children id passing to prevent cycles