Added valuable catch of exception in hostname resolving section.