Changed err.status to err.statusCode.