Additional logic for counter.