Implemented atomic increase in latch