correct a bug in views.py