view switch bugfix