Fixed bug when checking if host is null