corrected counting index by hash