fixed bug in linear regression