handling error in log file