fixed bu in write_stdout function in simulator class