updating the counter