change counter increment function in the Python binding