fix error processing