another change to models.py, this one to prevent index out of bounds exception