debugged app.py