add condition when delete duplicate record