fix scope of masking!!!