updated to try three times if a null is returned when getting a url