add counter to run_loop.py