updated logic for /count command