fixed bug in mask