- hopefully fixed bug that leaves partial file after an error