Fixed errors in views.py