Use user agent when checking availability; added ability to retry trials on failure