corrected error calculations to use deviance residuals in GLMs