fix error management