Update Pin9.py

add cleanup