fixed a bug in index page which was raising an error after creating events. modified the code in views.py