Sorted cname list
Fixed switching bug