why isnt upsert working