Added error handling when a view was not found while attaching them to an element