fix bug with collapse tree