add reset counter code