added check for model.id