fixed small bug with debug and log files