added events to buttons