Fixed issue referencing an incorrect variable.