Rework on atomic boolean