modify sort_uniq_namelist func