fixed directory lock in --daemon mode