handle log directory better.