added some checking for joint linear regression