keyerror fix
keyerror fix
keyerror fix
keyerror fix
changes to views.py