fixed bug - bad variable used [#1]
Merge pull request #2 from jasir/fix#1

Illegal string offset 'counter', line 240