implemented an error delegate