implement handling multi-thread concurrency