Added click events using if statements in view