functionality for view change