Added log file code