improve error handling for views

#18