fix mask copy