fixed calculation of errors on view