iterate childId before calling fork