fixed some minor bugs in app.py