Fixing crash when working with attributes from multiple threads