Adding error management functionality