fixed some counter issues