Added events to the buttons