Adding support for masking