Made debug count an atomic