change from using hash to using counter as id