removed bug in updating children length and cloning