Distributed: fixed problem with thread local database