fix for covariance matrix estimation