Make this a bit more resilient to bad urls