Fix undefined variable warning