Remove the switch_to_blog, instead use get_site_url and pass the  if available