validate duplicate elements