fixed backend code in views.py