clone data before insert or update