fixed the linear residual error