Fix a fatal mistake of file critical section