fix error code computing