Fixed a bug in routes.py