fixed wrong tree construction when selecting only certain columns