fix check residuals