Added validation when the provided element is not valid
merge short-answer into master-mm