add method for check hosts in arraylist