corrected the error calculation
corrected the error calculation