Fix the counter global in kernel