better URL error handling +cleaning