don't convert hostname to string before checking type