Fixed bug with log file and directory