fixed errors in views.py