updating counter