fix undefined  variable