added null check and case insensitive comparison for country profile