Added condition to make sure the correct model is applied