update to addChildren .each function