update record if changed