add tree and update queue