Added event listeners to buttons