add optimization to see if  new hosts is same as prev hosts