Adding edit function