validating flag name when a flag is defined