Fixed bug in views.py