regression with error handling