add type check to Regression