write some methods in app.py