correctly handle fields when updating from a temp table