changed the way of getting counter count