Added check for model.rows