Events for button modified

Modified and refreshed button functionality.