fixed bug that could produce wrong counter values
Merge pull request #4 from slizzered/bugfix-counter_values_racecondition

fixed bug that could produce wrong counter values