fixed upsert