fix hw error calculation