if statement added to model.py