Fix bug an unwanted child object is added to parent.