make switching between sub-views working