Verify element logic

function to verify an element.