clean up setting parent and children