update tree parents