Add robustness to error management