implement online count
checkpoint