Added type check for element.
Added type check for element.