fixed fs.readFile exception while calling toLog function