fix bug with is_host_local function