added logic to create sub-views under a nested view