counter is only global for testing