Set counter correct according to template