make code more resilient against corrupted URLs