Added setNextView to integrate with UI