Update app.py

Update the Handle State change