Fixed undefined variable warning
(cherry picked from commit 92f2319)