fix #135 undefined element in View

added a check when creating a view with an undefined element,
we now log an error.