use counter instead of id as the data is sorted by name