Fixed fetch_url function