fix a bug in views.py