update tree sorting