Fixed the problem with the "output to file" option