bugfix to mask