added log directory creation. segfaults