Added limit to number of tries for locating a random location.