adding function to create log file