fixing an incorrect counter