Fix leaky output variable

Added missing `var` before definition of the `output` variable.