The tree code is debugged. Now it is running fine.