fix and introduce locking spin counter