Properly setting err.statusCode