added proper error handler for koa