fixed writing to run.txt.