fixing broken counter