added check for existing log-dir