create error handler. remove unnecessary annotations