Do you mean to delete the row in your upd function ?
upd
You may also want to consider doing it this way
or use the native Spreadsheet component