update count field in model.