Minor fix to use the correct local variable