Add some error handling for creating views and models