Added back missing 'res' variable.