update binary tree