       dump "onChange INSERT_ROW null cache - sheet %s:'%s' rows %s.",
         sid, name, rows  if cachedRows is null
   if found
-    range = sheet.getRange "A#{rows}"
+    range = sheet.getRange "A#{getNewestRow(sheet)}"
     dump "onChange INSERT_ROW - sheet %s:'%s' rows %s (%s) range %s.",
       sid, name, rows, cachedRows, range.getA1Notation()
     setupNewRow range


formatRow = (row) ->
  dest = spreadsheet.getRange "A#{row}:A"
  source = dest.offset -1, 0
  source.copyTo dest, formatOnly: true

addNewRow = (sheet) ->
  sheet.appendRow [new Date()]
  updateCacheSheetRows sheet
  row = sheet.getMaxRows()
  formatRow row
  dump "addNewRow new and formatted %s", row

checkAndAddNewRow = ->
  ss = SpreadsheetApp.getActiveSpreadsheet()
  sheet = ss.getSheets()[0]
  dump "checkAndAddNewRow - examine date on sheet '%s'", sheet.getName()
  addNewRow sheet if not isMaxRowCurrent sheet
  flushLog()
  return


expireCache = ->
  sheets = spreadsheet.getSheets()

  name:'verbose'
  desc:'log to Log sheet'
  def:true
,
  name:'ascending'
  desc:'Add rows at bottom'
  def:false
,
  name:'trace'
  desc:'detailed execution trace to Log sheet'
