Fixed counter so it does't crash, it now increments apropriately