a.name.localecompare is not a function