added some methods in models.py