update EE part to implement UPSERT feature