updates tree node