Fix logdir bug