Adding events for buttons.