added validation for flag submissions