fix bug of counter