add upsert method