add register and unregister counters.