Update main.py

some fixes