fixing county calculation