removing bad flags