removes duplicate flags