fix undefined var