Added listeners to the buttons