avoid modifying input countries in library functions