added log file code