stop increment count if it's max number of occurrences