Added method to switch views