Added masking support