update app.py to handle upload success