Removed check for empty elements as there may be legitimate cases where element is empty