More robust endpoint selection