add debug counter support