fixed line 313 of views.py to fix error