Update main.py

added validity checks