Fix bugs on sort records

we should use true names of records while they have the same standard
names during comparison