Fix bug during the first run of the script

Call write_spreadsheet() correctly

Fixes #2