But your function, as you defined it, expects a series and not a var.