fix bug in tree prediction