replace unique_lock with lock_guard