script: add debug counters