Added function to change view