Check the model before adding the element.