update function fix if duplicate check array is empty