1. Start by writing the right name of the tree you want to interact with , im sure the tree name is "Yew tree" and not "tree"
2. You are assigning a new value to the "tree" var and you're not even using it anywhere and then directly after you just reassign a new value to it ? flawed logic
3. Can you post more code , that snippet doesn't tell us much?