update count variable