iterates through endpoints if first fails