fixed concurrency bugs in Mango