Adding upsert mode WIP