Add functions inside each view controller to handle UI events