fix bugs in active counts