added support for masking windows