Fix undefined local variable problem.