You just need to initialize the Feedback Node init terminal on the left side of the loop for your counter. Create a constant outside the loop on the terminal with a value of zero, or what ever you want the starting count to be.
The attached image shows this.
If you do not initialize the Feedback Node, or a Shift Register, it will remember the value that it last contained unless you change it or remove the VI from memory.
Ed