Fixing corrupted pointer when working with attributes from different threads