add event listeners on click with functions