added element validation