fix to mask check