fix country count function