bug fixed: --log-dir was not working. Now it can logs the output to specified directory