it would be good to clear the children list at the end