added eventListeners to buttons