moved internal counter in constructor