Added check for log file before removing.