Fix #16010 change variable
Merge pull request #87 from Kirill/issue16010

Fixes #16010: remove usage of undeclared variable.