(#1658) - use promises for upsert