Fix the logic from the last change of the log directory