Added logic to ChangeView