Another attempt to get view switching right