fix newFromUrl() method to follow redirects