hosts may be null, workaround