fixed the concurrent bug, workign without any deadlocks