Update tree expand logic