Tag counter sometimes counted wrong