Fixed undefined variable warning