fixed standard output file overwrite bug (did not work when potential file overwrite)