fixed the on of state of the buttons and added on selection event