fix tree expansion bug