fixed syntax, added counter