trying to fix concurrent bug but failed