sort list before merge