upgrade main.py