adapting the code to the updated error management classes