Added counter = 0 to reset