fixed a bug when log file creation failed