fixed bug in parsing logic (missing counter)