updated command handling in the app.py module