fixed counter bugs