fix potential bug to update record.