make exit button functional