counter working properly