flag correction