better interaction between d3 and tree