Fix update of only records that have changed