fix undefined when switching country from select to input