a small bug fix in the error estimation