Change goal tree query