Unable to reset repeatCount variable to 0 - C#