Fixing upsert