replace EmptyTree with Leaf