fix upsert