Fix improperly referenced variable
Merge pull request #2426 from ghost1227/issue/2424

Fix improperly referenced variable