tree to list fixed and testcase added