fixed a bug in models.py