changed flags and masks