added listener for the button groups