add upsert option