Fixed wrong variable name of res.