checking null in GenerateHostname