Add error handler on bad request