update flag counter