Fixing bugs on main.py