fix undeclared variable use
(cherry picked from commit c794c6d84a23393b7de63a221f3fa3b893eb5058)