Correct a variable name

Was using the wrong variable name, breaking the whole method.