add an error handler for bad requests