added replace node feature, fixed set num children