refactored country bug fix