added flag count