Fixing atomicreference