Added error checking for poll.py/detail.html