added write to file lines to indicate script status