Add error calculation for output