add error counts to each element