restored compareAndSet guard