Improved Error handling with _get_url