Deluge script to flag duplicates

Deluge script to flag duplicates

Hi,

I can't enable email as a unique field since there is a use case where there can be two leads for the same person e.g. buying two different services that require different workflows to happen at different times. But we get a lot of repeat inquiries in one of these workflows so there are duplicates coming into the system. 

So I am trying to flag duplicates using a checkbox called "Duplicate". I am using the below script to check the checkbox when an email is found to be the same as the new lead. Then I can show it in a view for someone to sort if they are actually duplicates or not, problem is it flags every lead every time. I thought it was picking up itself as a count but even when increase it to > 1 it does the same thing. What am I doing wrong?

leadid = Leads - ID
email = Leads - Email

relcont = zoho.crm.searchRecords("Leads","(Email:equals" + email + ")");
relcontsize = relcont.size();
if(relcontsize > 0)
{
update = zoho.crm.updateRecord("Leads",leadid,{"Duplicate":true});
}