fixing bugs in tree split