further improvments to debug count