replace thread module with threading
change call to urlparse