bug for flagged count