don't try to fclose the logfile if it hasn't been opened