added button actions and made clicking a button emit an event with its action