fix undefined variable warning