made the operations of the used counter atomic.