improved comparing tree name strings when sorting tree