change in code to give preference to matching data center instead of
just taking the last data center to be iterated through.