Rewrote insertRecord.