Fixed collapsible tree bug running outside scope