changed url handling to be more robust for domain naems