made cov handle masked data