debug tree and add search