fix problem with empty mask