add the function counter