Fixes issue with mask check