upsert working