fix the bug in find max distance of binary tree.