add btn event handler and method to generate data object