Fixed a bug in models.py init function