added event listeners connected to buttons