fixed unsafe concurrent access bug