Improving the visit counter