added buttons to the alert dialog and connected the buttons to to the correct actions