fixing an atomic violation