Fixed bug in view.py