clean up the URL stuff a bit more, add more descriptive failure message