fix undefined variable