made the buttons work properly