Fix bug with view toggle