Fixing concurrent bug