CRM Function Help

CRM Function Help

Hello, please help if this is possible.
I am trying to write a function that, when a lead comes in, gets the lead Company name, searches our Accounts Module for an account with that company name, retrieves the account owner for that company account, and automatically assigns the lead to the account owner. 

In the leads module, Company is a single-line field and Owner is a look up field
In the accounts module, Account_Name is a single-line field and Owner is a look up field as well.

This is what I have so far, but I keep getting an argument mismatch type error

leadId1 = zoho.crm.getRecordById("Leads",leadId.toLong());
compname = leadId1.get("Company");
accrec = zoho.crm.searchRecords("Accounts","(Account_Name:equals:compname)");
accOwner = accrec.get("Owner");
mp = Map();
mp.put("Owner",accOwner);
updateResp = zoho.crm.updateRecord("Leads",leadId1,mp);