deal with errors