added error handling for wrong urls