fix multi-threaded access to shared data
Add logger to the project