fixed small bug in logfile opening